home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / UTILREEN / BITFNT38.LZH / NLQDRAFT.BFC < prev    next >
Text File  |  1987-05-03  |  4KB  |  134 lines

  1. N,"NLQ Printer Draft";
  2.   x: df=2;      {init data format to 2}
  3.   x: xd=2;      {double horizontal density}
  4.   x: yd=1;      {one pass, normal vertical density}
  5.   x: to=6;
  6.   x: lo=0;
  7.   x: cw=11;
  8.   x: ch=8;
  9.   x: ep=11,"Ending Point";
  10.   x: sp=0,"Starting Point";
  11.   x: sh=1,"Shift (0=shift down,1=none)";
  12.  
  13.   a: aa=0;      {not allow adjacent dots}
  14.   a: fw=11;
  15.   a: fh=9;
  16.   a: bl=6;
  17.  
  18.   a: d8=0;   {d8=1 says downloading}
  19. E; {end initialization section.}
  20. KI; {start input font header.}
  21. EI; {end input font header.}
  22. L 8;
  23. j 12:fp,ge,fs; {L12 is end of file reached}
  24.   u: zz;
  25.   j 8: zz,ne,$1b; {look for esc}
  26.   u: zz;
  27.   j 8: zz,ne,$26; {look for x'26'}
  28.   u: zz;
  29.   j 8: zz,ne,$00;  {look for 0 }
  30.   u: cc;      {decimal code of character}
  31.   u: cc;      {decimal code of character}
  32. L 1; {label 1 to indicate start of character.}
  33. $ : cc,"Loading code (hex) ";
  34.   x: df=2;      {init data format to 2}
  35.   x: pd=2;      {double horizontal density}
  36.   x: pp=1;      {one pass, normal vertical density}
  37.   x: cw=11;
  38.   x: ch=8;
  39.   u: at;{attribute data: bit 0=top offset, 1-3=left offset, 4-7=endpoint}
  40.   x: sh=at/128;
  41.   x: to=1-sh+6;
  42.   x: lo=0;
  43.   a: a1=at/16; {get hi 4 bits of at}
  44.   a: a2=sh*8;  {get sh bit ready for subtracting}
  45.   x: sp=a1-a2;
  46.   a: a1=at/16*16; {partial calc to strip off hi 4 bits of at}
  47.   x: ep=at-a1;    {ending proportional position}
  48.   g; {character data}
  49. ESL; {end character search, character loaded.}
  50.   j 8:1,eq,1; {go get next char}
  51. L 12; {end of file reached}
  52. #:**,"Font loaded.";
  53. KT; {start input font trailer.}
  54. ET; {end font trailer.}
  55. KS; {start search for an input character.}
  56.   z 10:fs-fp;
  57.   L 9;
  58.   u: zz;
  59.   j 9: zz,ne,$1b; {look for esc}
  60.   u: zz;
  61.   j 9: zz,ne,$26; {look for x'26'}
  62.   u: zz;
  63.   j 9: zz,ne,$00;  {look for 0 }
  64.   d: zc;      {decimal code of character}
  65. $: zc,"Encountered code (hex): ";
  66. #: fp,"At file position: ";
  67. j 9: zc,ne,cc;
  68. # : cc,"Found code (dec)";
  69.   j 1: 1,eq,1;   {found, go get it}
  70. L 10;       {char not found}
  71. ESU; {end character search program (unsuccessful search)}
  72. KO; {start output font header.}
  73. L 88; {for download}
  74. #:**, "Sending Font Header ";
  75.   u:$1b;   {this starts rom cg copy to initialize char set to default}
  76.   y:":";
  77.   u:$00;
  78.   u:$00;
  79.   u:$00;
  80. EO; {end output font header.}
  81. a:cc=0;  {start with first possible code, zero}
  82. c;       {select first valid code}
  83. j 57:1,eq,1; {bypass first code check}
  84. L 55;
  85.   c;  {select first valid code}
  86. j 59:cc,eq,0;  {go to 59 if no more valid codes}
  87. L 57;
  88. KC; {start output character.}
  89. $ :cc,"Sending code (hex): ";
  90.   u:$1b;
  91.   u:$26;
  92.   u:$00;
  93.   u: cc;      {decimal code of character}
  94.   u: cc;      {decimal code of character}
  95.   a: a1=sh*128;  {set hi bit of attribute data}
  96.   a: a2=sp*16;   {set starting point, bits 1-3 of attribute data}
  97.   u: a1+a2+ep;   {output attribute data byte}
  98. j 4: ch,gt,8;    {can only output a char height of 8 bits}
  99.   g;   {character data}
  100. j 5: 1,eq,1;
  101. L 4; {outputs every other byte of character data, assume ch=9}
  102.      {this will strip off lowest line of character, if it exists}
  103.      {recommended to shift up any downshifted character on design screen}
  104.   g;0,1;
  105.   g;2,1;
  106.   g;4,1;
  107.   g;6,1;
  108.   g;8,1;
  109.   g;10,1;
  110.   g;12,1;
  111.   g;14,1;
  112.   g;16,1;
  113.   g;18,1;
  114.   g;20,1;
  115. L 5;
  116. EC; {end output character.}
  117. a:cc=cc+1;
  118. j 55:1,eq,1;
  119. L 59;   {end}
  120. KZ; {start output font trailer.}
  121. j 89:d8,eq,1; {go finish download if downloading}
  122. ET; {end font trailer.}
  123. KP; {start download}
  124.   a:d8=1;  {downloading indicator}
  125. j 88: 1,eq,1; {go save font to the printer}
  126. L 89; {now select download char set}
  127.   a:d8=0; {turn off download indicator}
  128.   u:$1b;
  129.   u:$25;
  130.   u:$01;
  131.   u:$00;
  132. EP; {end download}
  133. .
  134.